<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>New Company</title>
	<meta name="author" content="n" />
	<!-- Date: 2011-11-11 -->
</head>

<style>
body,input,textarea{
	font-family: Meiryo,Verdana;
	font-size: 13px;
}
</style>

<body>
	
<h1>新しい企業を追加</h1>
<a href="/admin">admin</a>&nbsp;

<form action="/admin/insert" method="post">

<table>
<?php foreach ($company_fields as $field) if ( $field["name"] === "type"){?>
	
	<tr>
		<th><?php echo $field["name"]?></th>
		<td>
			<?php foreach ($intern_type as $key => $value) {
				echo $value.form_checkbox('type[]', $key, false)."&nbsp;&nbsp;";
			}?>
		</td>
	</tr>
	
<?php }else if ($field["name"] === "what_id"){?>
	
	<tr>
		<th><?php echo $field["name"]?></th>
		<td>
			<?php foreach ($what_name as $key => $value) {
				echo $value.form_checkbox('what_id[]', $key, false)."&nbsp;&nbsp;";
			}?>
		</td>
	</tr>

<?php }else if ($field["name"] === "area_id"){?>
	
	<tr>
		<th><?php echo $field["name"]?></th>
		<td>
			<?php foreach ($area_name as $key => $value) {
				echo $value.form_checkbox('area_id[]', $key, false)."&nbsp;&nbsp;";
			}?>
		</td>
	</tr>

<?php }else if ($field["name"]!="id" && $field["name"] !="delete_tag"){?>
	
	<tr>
		<th><?php echo $field["name"]?></th>
		
		<?php if ($field["type"] === "string" || $field["type"] === "int"){?>
			
		  <td><input type="text" size="40" name="<?php echo $field["name"]?>" value="" /></td>
		  
		<?php }else{?>
			
		  <td><textarea cols="60" rows="7" name="<?php echo $field["name"]?>"></textarea></td>
		  	
		<?php }?>
		
	</tr>
	
<?php }?>
</table>

<input type="submit" value="Preview" />&nbsp;
<input type="reset" value="Reset" />

<h2>Meta Info</h2>

<table>
<?php foreach ($company_meta_fields as $field) if ($field["name"]!="id" && $field["name"]!="company_id"){?>
	<tr>
		<th><?php echo $field["name"]?></th>
		
		<?php if ($field["type"] === "string" || $field["type"] === "int"){?>
			
		  <td><input type="text" size="40" name="<?php echo $field["name"]?>" value="" /></td>
		  
		<?php }else{?>
			
		  <td><textarea cols="60" rows="7" name="<?php echo $field["name"]?>"></textarea></td>
		  	
		<?php }?>
		
	</tr>
<?php }?>
</table>

<input type="submit" value="Preview" />&nbsp;
<input type="reset" value="Reset" />

</form>

</body>

</html>
